package com.dt76.smallloanbackendservice.controller.ysy;

import com.dt76.smallloanbackendservice.pojo.ysy.YVerify;
import com.dt76.smallloanbackendservice.service.ysy.InOutService;
import com.dt76.smallloanbackendservice.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/ysy")
public class InOutController {
    @Autowired
    private InOutService inOutService;

    @RequestMapping("/inOut")
    @ResponseBody
    public List<YVerify> qryAll(){
        return inOutService.qryAll();
    }

    @RequestMapping("/delInout")
    @ResponseBody
    public Result delInout(@RequestParam("rId") int rId){
        System.out.println("成功调用远程服务:userservice>delete>>>");
        try {
            inOutService.delInout(rId);
            return new Result(true,"删除成功>>>");
        } catch (Exception e) {
            return new Result(false,"删除失败>>>");
        }

    }
}
